package com.designpattern.structure.enjoy;

/**
 * @author Administration
 * @date 2021/10/19 - 15:03 - 星期二
 * @project lambda
 * @package com.designpattern.structure.enjoy
 * @by 晨
 */
public class test {
    public static void main(String[] args) {
        BoxFactory boxFactory = BoxFactory.SingletonHolder();

        AbstractBox i = boxFactory.getBox("I");
        i.display("蓝色");

        AbstractBox l = boxFactory.getBox("L");
        l.display("黑色");

        AbstractBox o = boxFactory.getBox("O");
        l.display("红色");

        AbstractBox o1 = boxFactory.getBox("O");
        o1.display("紫色");

        System.out.println("o和o1两个对象地址值是否一样" + (o == o1));
    }
}
